package com.dubbo.cp.provider.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.dubbo.cp.entity.RoleEntity;

@Mapper
public interface RoleMapper {

	@Select("select * from role where 1 = 1")
	public List<RoleEntity> getRoleList();
	
	@Select("select * from role where role = #{role}")
	public RoleEntity findRoleByRole(@Param("role")String role);
	
	@Insert("insert into role(role) values(#{role})")
	public void insertRoleEntity(RoleEntity roleEntity);
	
	@Delete("delete from role where id = #{id}")
	public void deleteById(int id);
	
	@Update("update role set role = #{role} where id = #{id}")
	public void UpdateRoleEntity(RoleEntity roleEntity);
	
	@Select("select * from role where id = #{id}")
	public RoleEntity findRoleByRoleid(@Param("id")int id);
	
	@Select("select * from role limit #{arg0},#{arg1} ")
	public List<RoleEntity>getRoleByPage(int start, int size);//分页查询角色的信息
	
}
